package cn.merryyou.generator.dto;

public class ResponseUtil {

    public static <T> ResponseDto<T> successLayuiData(T data, long count) {
        ResponseDto<T> r = new ResponseDto(0, "success", data);
        r.put("count", count);
        return r;
    }

    public static <T> ResponseDto<T> success(int code, T data) {
        return new ResponseDto(code, "success", data);
    }

    public static ResponseDto error(int code, String msg) {
        return new ResponseDto(code, msg, null);
    }

}
